package com.enen.demo.dao;

import com.enen.demo.bean.Category;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CategoryDao {
//    @Insert("insert into cms_category(id, name, description, no, parent_id) values(#{id}, #{name}, #{description}, #{no}, #{parentId})")
    void save(Category category);

//    @Select("select * from cms_category")
    List<Category> selectAll();

//    @Select("select * from cms_category where id = #{id}")
    Category selectById(long id);

//    @Update("update cms_category set name=#{name}, description=#{description}, no=#{no}, parent_id=#{parentId} where id = #{id}")
    void update(Category category);

//    @Delete("delete from cms_categoty where id = #{id}")
    void delete(long id);


}
